SNIPPET

;Instructions

if the hash table is needed to be made and loaded first
You will see a dialog appearing asking you to locate directory containing hash table
you want to make and load

if you want to make and load hash table first, then add "-z" to end
if you don't want to free hash table at end, then add a "-x" after the z
space in between the -z and -x , see usage below

if you previouslly saved the hash table as a binary file, data only or ini format
you will need to apply the respective switches for this, hense what the <switches> is for
-b = binary file , -n = data read only , -i = hash table treated like a ini file

USAGE: /get.hash <hash table name> <switches> -z -x

Now its very important you have 3 items after the hash table name, even if you don't want to
use a certain part. so any part you don't want to use, replace with a "no", see below


USAGE; /get.hash <hash table name> no no -x

alias get.hash {
window -ak(0) @hash
aline @hash Item $chr(9) $chr(9) Data
aline @hash ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var %hash.name = $1
var %switches = $2
if ( $3 == -z ) {
var %hashtable = $+(",$sfile($mircdir),")
hmake %hash.name
if ( %switches == no ) { hload %hash.name %hashtable }
else { hload %switches %hash.name %hashtable }
}
var %i = 1
while ( $hget(%hash.name,%i).item ) {
var %item = $ifmatch , %data = $hget(%hash.name,%i).data
aline @hash %item $chr(9) $chr(9) %data
inc %i
}
if ( $4 == -x ) { hfree %hash.name }
}